import jdk.swing.interop.SwingInterOpUtils;

import java.io.File;
import java.io.IOException;

public class Demo1 {
    public static void main(String[] args) throws IOException {
        File file=new File("../test.txt");
        System.out.println(file.getParent()); //文件的父目录
        System.out.println(file.getName());//文件名称
        System.out.println(file.getPath());
        System.out.println(file.getAbsolutePath());
        System.out.println(file.getCanonicalPath());
    }
}
